<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
	<div id="app">
		<button v-for="(item,index) in items" @mouseenter="mouseenter" @mouseleave="mouseleave">{{item}}</button>
	</div>
	
	<script>
		var app = new Vue({
			el:'#app',
			data:{
				items:["教父","阿甘正传","楚门的世界","盗梦空间"]
			},
			methods:{
			    mouseenter(e){
			        e.target.style.backgroundColor = 'red';
			    },
			    mouseleave(e){
					e.target.style.backgroundColor = '';
				}
			}
		})
	</script>
</body>
</html>